/* Copyright (C) 2010 Fredrique Samuels, fredriquesamuels@gmail.com */

/*
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef TRI_EXT_COMBOBOX_H_
#define TRI_EXT_COMBOBOX_H_

#include <iostream>
#include <vector>
#include <string>
#include <map>

//Include library header
#include "label.h"
#include "itemlist.h"
#include "popup.h"
#include "scrollpanel.h"

namespace tri{
namespace ui{	

class extComboBox : public tri::ui::extLabel,public sigslot::has_slots<sigslot::multi_threaded_local>{

public:
	extComboBox();
	virtual ~extComboBox();
	virtual void update();
	virtual void pack();
	void addItem(std::string item);
	void removeItem(std::string item);
	void clear();
	std::string getSelectedItem();
	
private:
	
	void showPopup();
	void onItemClicked();
	
	tri::ui::extPopup mPopup;
	tri::ui::extItemList mItemListPanel;
	tri::ui::extButton mButton;
	tri::ui::extScrollPanel mItemScrollBox;
	
};

}
}
#endif
